package com.open.admin.controller;


import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.open.admin.entity.ResponseResult;
import com.open.admin.resp.MenuDTO;
import com.open.admin.service.IMenuService;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 */
@RestController
public class MenuController {

	@Autowired
    private IMenuService menuService;
	
    @GetMapping("/menu/list")
    public ResponseResult<List<MenuDTO>> getMenusByHrId() {
    	List<MenuDTO> list = menuService.getMenusByUserId();
    	if(CollectionUtils.isEmpty(list)) {
    		list = new ArrayList<>();
    	}
        return new ResponseResult<>(200, list);
    }
    
}

